CC=g++
CFLAGS=-Wall -O3 -std=gnu++0x
TCLAP_INCLUDE=./
OBJS=puzatopic.o utils.o io.o def.o topicmodel.o log.o cmd.o lngamma.o digamma.o
puzatopic.exe:$(OBJS)
	rm -rf *~
	$(CC) -o puzatopic.exe $(OBJS)
puzatopic.o:puzatopic.cpp io.hpp cmd.hpp def.hpp metamodel.hpp topicmodel.hpp utils.hpp log.hpp
	$(CC) $(CFLAGS) -c -I $(TCLAP_INCLUDE) puzatopic.cpp
topicmodel.o:utils.hpp def.hpp log.hpp io.hpp topicmodel.hpp topicmodel_getmodel.hpp topicmodel.cpp topicmodel_generic_model.hpp topicmodel_lda_abstract.hpp topicmodel_lda_gibbs.cpp
	$(CC) $(CFLAGS) -c -I $(TCLAP_INCLUDE) topicmodel.cpp
cmd.o:cmd.cpp cmd.hpp def.hpp singleton.hpp
	$(CC) $(CFLAGS) -c -I $(TCLAP_INCLUDE) cmd.cpp
log.o:def.hpp io.hpp log.hpp log.cpp singleton.hpp
	$(CC) $(CFLAGS) -c -I $(TCLAP_INCLUDE) log.cpp
utils.o:def.hpp utils.hpp utils.cpp singleton.hpp lngamma.hpp digamma.cpp
	$(CC) $(CFLAGS) -c -I $(TCLAP_INCLUDE) utils.cpp
io.o:def.hpp io.hpp io.cpp singleton.hpp
	$(CC) $(CFLAGS) -c -I $(TCLAP_INCLUDE) io.cpp
def.o:def.hpp def.cpp singleton.hpp
	$(CC) $(CFLAGS) -c -I $(TCLAP_INCLUDE) def.cpp
lngamma.o:lngamma.cpp lngamma.hpp
	$(CC) $(CFLAGS) -c lngamma.cpp
digamma.o:digamma.cpp digamma.hpp
	$(CC) $(CFLAGS) -c digamma.cpp
clean:
	rm -rf *~ *.o puza.exe
tar:
	tar zcfv puzatopic.tar.gz *.cpp *.hpp Makefile
